<html>
<head>
    <title>
        test
    </title>
</head>
<body>
<!--判断文件大小-->
<input id="GF" type="file" accept="image/*">
<script>

    let asd= document.getElementById("GF")
    asd.addEventListener("change",()=>{
        console.log(asd.files[0].size/1024/1024) ;   //单位MB
    });

</script>
</body>
</html>